package ModelLayer;
import java.util.ArrayList;


public class DVD
{
    public long id;
    private String title;
    private String artist;
    private String publicationDate;
    private CollectionOfCopies copies;
    
    /* Constructor for DVD class */
    public DVD(long id, String title, String artist, String publicationDate)
    {
        this.id = id;
        this.title = title;
        this.artist = artist;
        this.publicationDate = publicationDate;
        copies = new CollectionOfCopies();        
    }
    
    /* Print method */
    public void printInfo()
    {
        System.out.println("Id : " + id);
        System.out.println("Titel : " + title);
        System.out.println("Artist : " + artist);
        System.out.println("Publication date : " + publicationDate);
    }
    
    /* Get methods */
    public long getId()
    {
        return id;
    }
    
    public String getTitle()
    {
        return title;
    }
    
    public String getArtist()
    {
        return artist;
    }
    
    public String getDate()
    {
        return publicationDate;
    }
    
    /* Set method */
    public void setId(long id)
    {
        this.id = id;
    }
    
     public void setTitle(String title)
    {
        this.title = title;
    }
    
     public void setArtist(String artist)
    {
        this.artist= artist;
    }
    
     public void setDate(String publicationDate)
    {
       this.publicationDate = publicationDate;
    }
    
    /* An Arraylist to store the arraylist for the copies */
    public ArrayList<Copy> getCopies()
    {
        return copies.getCopies();
    }
    
    /* Check for a specific copy after id */
    public Copy getCopy(long copyId)
    {
        for(Copy copy : copies.getCopies())
        {
            if(copy.getId() == copyId) {    
                return copy;
            }
        }
        return null;
    }
    
}
